using System.Data.Common;
using System.Data.SqlServerCe;

namespace Be.Timvw.Framework.Data.SqlCe
{
    //<?xml version="1.0" encoding="utf-8" ?>
    //<configuration>
    //  <connectionStrings>
    //    <add name="localdb" providerName="System.Data.SqlServerCe" connectionString="Data Source='C:\mobileshare\demonorthwind.sdf';"/>
    //    <add name="localnorthwind" providerName="System.Data.SqlClient" connectionString="Data Source=LOCALHOST\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True"/>
    //  </connectionStrings>
    //  <system.data>
    //    <DbProviderFactories>
    //     <add name="SQL Server Everywhere Edition Data Provider"
    //               invariant="System.Data.SqlServerCe"
    //                 description=".NET Framework Data Provider for Microsoft SQL Server Everywhere Edition"
    //                 type="SqlCeApplication.SqlCeClientFactory, SqlCeApplication" />
    //    </DbProviderFactories>
    //  </system.data>
    //</configuration>

    public class SqlCeClientFactory : DbProviderFactory
    {
        public static readonly SqlCeClientFactory Instance = new SqlCeClientFactory();

        public override DbCommand CreateCommand()
        {
            return new SqlCeCommand();
        }

        public override DbCommandBuilder CreateCommandBuilder()
        {
            return new SqlCeCommandBuilder();
        }

        public override DbConnection CreateConnection()
        {
            return new SqlCeConnection();
        }

        public override DbDataAdapter CreateDataAdapter()
        {
            return new SqlCeDataAdapter();
        }

        public override DbParameter CreateParameter()
        {
            return new SqlCeParameter();
        }
    }
}